package com.bw.home.widget

import android.content.Context
import android.view.LayoutInflater
import android.widget.Toast
import com.bw.home.R
import com.bw.home.databinding.BottomdialogReplyBinding
import com.google.android.material.bottomsheet.BottomSheetDialog

/**
 * @author:created by hahajing
 * 时间：2024/5/7 0007
 * 企鹅号:444511958
 * 描述:
 */
class ReplyBottomDialog: BottomSheetDialog {
    private lateinit var binding:BottomdialogReplyBinding
    constructor(context: Context):super(context){
        val view = LayoutInflater.from(context).inflate(R.layout.bottomdialog_reply,null,false)
        binding = BottomdialogReplyBinding.bind(view)
        setContentView(binding.root)
        binding.tvBottomdialogReplyClose.setOnClickListener {
            dismiss()
        }
        binding.tvBottomdialogReplySend.setOnClickListener {
            val content = binding.etBottomdialogReplyContent.text.toString().trim()
            if (content.isBlank()){
                Toast.makeText(context,"请输入回复内容",Toast.LENGTH_SHORT).show()
                return@setOnClickListener
            }
            replyListener(content)
        }
    }
    constructor(context: Context,theme: Int):super(context,theme){

    }

    var replyListener:(String)->Unit = {}

}